#ifndef __H_GAME_H__
#define __H_GAME_H__

#include <deque>
#include <vector>
#include <map>
#include <set>
#include "ICC_Timer_Handler.h"
#include "RedisClient.h"
#include "GameBase.h"
#include "DbPart.h"
#include "CClient.h"
#include "def.h"
#include "LogicData.h"

#include <rabbitmq-c/amqp.h>
#include <rabbitmq-c/tcp_socket.h>

typedef struct ValidFlowRegisterData{
    int svtype;         // 服务类型
    int cmd;         // 命令
    ValidFlowRegisterData() : svtype(0), cmd(0) {}
}ValidFlowRegisterData;

class CHost;

class CGameServer : public BYTimerOject
{
public:
	CGameServer();
	virtual ~CGameServer();
public:
	virtual bool InitGame();
	virtual int OnBYTimeOut(int Timerid);
	int ProcessPacket(SocketHandler * pHandler, NETInputPacket* inputPkg);
private:

	int procFlowPush(SocketHandler* pHandler, NETInputPacket* inputPkg);
	int procFlowMQ(SocketHandler* pHandler, NETInputPacket* inputPkg);
	int procAgencyAccountMQ(SocketHandler* pHandler, NETInputPacket* inputPkg);

	bool initmq(void);
	//bool initmq1(void);
	void releasemq(void);
	//void releasemq1(void);
	bool ReadCommonConf(const char* strxml);

	std::string m_mqIp;
	unsigned short m_mqPort;
	std::string m_mqVhost;
	std::string m_mqUsername;
	std::string m_mqPwd;

	amqp_connection_state_t m_mqconn;
	amqp_connection_state_t m_mqconn1;
	int m_mqchannel;
	int m_mqchannel1;

	static char* s_szexchangetype;
	static char* s_szexchange;
	//static char* s_szexchange1;
	static char* s_szexAgencyChange;
public:
	CHost* m_pHost;
	//CDbPart m_dbHandler;
};


#endif


